/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.bc;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.tramite.bc.DocumentoFacadeLocal;
import org.cip.esymons.tramite.be.Documento;

/**
 *
 * @author ADMINISTRADOR
 */
public class DocumentoDelegate {

    private DocumentoFacadeLocal local;

    public DocumentoDelegate() {

        local = lookupDocumentoFacade();
    }

    public Documento buscaDocumento(String numero){

        return local.buscaDocumento(numero);
    }


    private DocumentoFacadeLocal lookupDocumentoFacade() {
        try {
            Context c = new InitialContext();
            return (DocumentoFacadeLocal) c.lookup("java:comp/env/DocumentoFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }



}
